<?php 
	$paths = array(
		".",
		"..",
		"../..",
		"../../..",
		"../../../..",
		"../../../../..",
		"../../../../../..",
		"../../../../../../..",
		"../../../../../../../.."
	);
	
	foreach($paths as $path) 
	{
		if(@include( $path.'/wp-load.php'))
		{
			break;
		}
	}
	
	global $wpdb;
	
	$db_name = "3d_slider"; 
	include (TEMPLATEPATH . '/framework/includes/get_'.$db_name.'_db.php');

	$slider_datas = $wpdb->get_results("SELECT * FROM $table_name ORDER BY orderby");
	
	
	header('Content-type: text/xml');
	echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
?>

<Piecemaker>
  <Settings>
    <imageWidth><?php echo get_option('3d_slider_width', '900'); ?></imageWidth>
    <imageHeight><?php echo get_option('3d_slider_height', '350'); ?></imageHeight>
    <segments>10</segments>
    <tweenTime>2.5</tweenTime>
    <tweenDelay>0.1</tweenDelay>
    <tweenType>easeInOutBack</tweenType>
    <zDistance>100</zDistance>
    <expand>10</expand>
    <innerColor>0x111111</innerColor>
    <textBackground>0x333333</textBackground>
    <shadowDarkness>75</shadowDarkness>
    <textDistance>25</textDistance>
    <autoplay><?php if(get_option('3d_slider_auto_play', 'on') == "on"){ echo get_option('3d_slider_speed', '5');  } else { echo "90000"; } ?></autoplay>
  </Settings>

  <?php foreach ($slider_datas as $data) { ?>
  <Image Filename="<?php echo $data->src ?>">
	<?php if($data->title != "" and $data->description !=""){ ?>
    <Text>
      <headline><?php echo $data->title ?></headline>
      <break>&nbsp;</break>
      <paragraph><?php echo $data->description ?></paragraph>
    </Text>
	<?php } ?>
  </Image>
  <?php } ?>
  
</Piecemaker>